<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户列表</title>
	<include file="Public:header" />
	<style type="text/css">
		/*input,textarea{width:180px;border:1px solid #ccc;padding:2px;}*/
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		function delete_todo()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要删除的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要删除选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Index/account_del')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		function selectall_todo()
		{
			$("input[name='chk_list']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list']").attr("checked",false);
		}
	</script>
</head>
<body class="">
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>通过管理员账密登陆后，可以管理整个系统</div>
	</div>
	<div class=" space-out-10px">
	
	<div class="list-title">
		<div class="list-t-l w50px"></div>
		<div class="list-t-l w60px">ID</div>
		<div class="list-t-l w100px">用户名</div>
		<div class="list-t-l w60px">角色</div>
		<div class="list-t-l w150px">最后登陆时间</div>
		<div class="list-t-l w100px">最后登陆IP</div>
		<div class="list-t-l w60px">状态</div>
		<div class="list-t-l">操作</div>
		<div class="list-t-r">
		<a href="{:U('Index/account_list')}" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
		<a href="{:U('Index/account_add')}" class="easyui-linkbutton" iconCls="icon-add">新增人员</a>
		</div>
	</div>
	<php>$role_list=array('user'=>'用户','pos'=>'前台POS','admin'=>'管理员');</php>
	<volist name="acc_list" id="acc_list">
	<div class="list-body">
		<div class="list-t-l w50px"><if condition="($acc_list['username'] eq 'admin') OR ($acc_list['username'] eq 'misone')">&nbsp;<else /><input type="checkbox" name="chk_list" value="{$acc_list.id}" style="margin-top:6px;" /> </if></div>
		<div class="list-t-l w60px">{$acc_list.id}</div>
		<div class="list-t-l w100px">{$acc_list.username}</div>
		<div class="list-t-l w60px">{$role_list[$acc_list['role']]}</div>
		<div class="list-t-l w150px">{$acc_list.logintime|date="Y-m-d H:i:s",###}</div>
		<div class="list-t-l w100px">{$acc_list.loginip}</div>
		<div class="list-t-l w60px"><img src="__PUBLIC__/Images/{$acc_list.status_flg}.png" alt="{$acc_list.status_flg}" title="{$acc_list.status_flg}" /></div>
		<div class="list-t-l"><a href="{:U('Index/account_edit?id='.$acc_list['id'].'')}">编辑</a></div>
	</div>
	</volist>
	<div class="list-title">
		<div class="list-t-l">操作：<a href="javascript:;" onclick="selectall_todo()">全选</a> - <a href="javascript:;" onclick="selectall_undo()">取消选择</a> - <a href="javascript:;" onclick="delete_todo()">删除</a></div>
		<div class="list-t-r">
		<a href="{:U('Index/account_list')}" class="easyui-linkbutton" iconCls="icon-reload">刷新</a>
		<a href="{:U('Index/account_add')}" class="easyui-linkbutton" iconCls="icon-add">新增人员</a>
		</div>
	</div>
	
	
	</div>
</body>
</html>
